package customer

import "time"

type CustomerGroupPo struct {
	ID              int64     `gorm:"primaryKey" json:"id"`
	Title           string    `gorm:"type:varchar(100);not null" json:"title"`
	IsPublic        int32     `gorm:"type:tinyint(2);not null;default:0" json:"is_public"`
	CommonFileUid   string    `gorm:"type:varchar(32);not null" json:"common_file_uid"`
	LandUsage       string    `gorm:"type:varchar(5000);not null" json:"land_usage"`
	LandUsageOp     int32     `gorm:"type:tinyint(1);not null;default:1" json:"land_usage_op"`
	LandTitle       string    `gorm:"type:varchar(1000);not null" json:"land_title"`
	LandTitleOp     int32     `gorm:"type:tinyint(1);not null;default:1" json:"land_title_op"`
	BuildingType    string    `gorm:"type:varchar(5000);not null" json:"building_type"`
	BuildingTypeOp  int32     `gorm:"type:tinyint(1);not null;default:1" json:"building_type_op"`
	BuildingTitle   string    `gorm:"type:varchar(1000);not null" json:"building_title"`
	BuildingTitleOp int32     `gorm:"type:tinyint(1);not null;default:1" json:"building_title_op"`
	BidTitle        string    `gorm:"type:varchar(1000);not null" json:"bid_title"`
	BidTitleOp      int32     `gorm:"type:tinyint(1);not null;default:1" json:"bid_title_op"`
	WinBidTitle     string    `gorm:"type:varchar(1000);not null" json:"win_bid_title"`
	WinBidTitleOp   int32     `gorm:"type:tinyint(1);not null;default:1" json:"win_bid_title_op"`
	Status          int32     `gorm:"type:tinyint(1);not null;default:0" json:"status"`
	Total           int64     `gorm:"not null;default:0" json:"total"`
	IsDeleted       int32     `gorm:"type:tinyint(1);not null;default:0" json:"is_deleted"`
	CreatedOn       time.Time `gorm:"type:datetime;not null;default:CURRENT_TIMESTAMP" json:"created_on"`
	CreatedBy       string    `gorm:"type:varchar(36);not null;default:''" json:"created_by"`
	ModifiedOn      time.Time `gorm:"type:datetime;not null;default:CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP" json:"modified_on"`
	ModifiedBy      string    `gorm:"type:varchar(36);not null;default:''" json:"modified_by"`
}

func (t CustomerGroupPo) TableName() string {
	return "customer_group"
}

type GroupListItem struct {
	Id          int64     `json:"id"`
	Title       string    `json:"title"`
	Total       int64     `json:"total"`
	IsPublic    int32     `json:"is_public"`
	Status      int32     `json:"status"`
	FileId      string    `json:"file_id"`
	FilePath    string    `json:"file_path"`
	CreatedBy   string    `json:"created_by"`
	CreatedOn   time.Time `json:"created_on"`
	TenantCodes string    `json:"tenant_codes"`
}
